<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渐变</title>
    <style>
        .box{
            position: relative;
            width: 300px;
            height: 300px;
        }
        .box img{
            width: 300px;
        }
        .box .title{
            position: absolute;
            left: 15px;
            bottom: 20px;
            z-index: 2;
            width: 260px;
            color: #00fbff;
            font-size: 28px;
            font-weight: 700;
            text-align: center;
        }
        .mask{
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-image: linear-gradient(
                transparent,
                rgba(0,0,0,0.5)
            );
            opacity: 0;
            transition: all .5s;
        }
        .box:hover .mask{
            opacity: 1;
        }
    </style>
</head>
<body>
    <div class="box">
        <img src="../img/touxiang.png">
        <div class="title">劲夫劲夫，全场欢呼</div>
        <div class="mask"></div>
    </div>
</body>
</html>